# -*- coding: utf-8 -*-
from base import BaseHandler

class PreloadHandler(BaseHandler):
	"""
	Handler to run application that is already initialized. Only runs the application.
	"""
	data = ''
	def __call__(self, environ, start_response, exc_info=None):
		""" """
		self.environ = environ
		self.start_response = start_response
		self.app = self.orig_app
		if(not self.environ.has_key('renyare.config')):
			raise self._err("No config variable")
		try:
			app = self.app(environ, start_response)
		except:
			self._err("Error running %s application: %s" % (self.module_type, str(sys.exc_info()[1])))
		return app
